import React from 'react';

import ReactDom from 'react-dom';

class Sub extends React.Component{
    constructor(props){
        super(props);

        this.state = {num:0};
        this.chuli = this.chuli.bind(this);
    }

    chuli(){
        ++this.state.num;
        if(!(this.state.num%5)){
            this.props.onFive(this.state.num);
        }
        if(this.state.num==1){
            console.log('提交表单!')
        }
    }

    render(){
        return <button onClick={this.chuli}>点击我5此以上</button>;
    }
}

export default Sub;
